package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


/**
 * @program: springMVC
 * @description:
 * @author: Mr.peng
 * @create: 2020-05-20 09:41
 **/
@Controller
public class hellocontroller {
    @RequestMapping("/hello")
    public ModelAndView handleRequest(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws Exception {
       ModelAndView mav=new ModelAndView("index");
        mav.addObject("message","学框架就学Spring MVC！");
        System.out.println("helloe Spring MVC");
        return mav;
    }

    @RequestMapping("/two")
    public String hans(){
     // ModelAndView mav=new ModelAndView("index");
//        mav.addObject("message","学框架就学Spring MVC,yes！");
        System.out.println("哈哈哈哈哈");
        return "gone";
    }
}
